﻿<phone:PhoneApplicationPage x:Class="BingMaps.View.SearchAreaPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:Behaviors="clr-namespace:WP7Contrib.View.Controls.Behaviors;assembly=WP7Contrib.View.Controls"
                            xmlns:Microsoft_Phone_Controls_Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
                            xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP71"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            mc:Ignorable="d"
                            d:DesignHeight="768"
                            d:DesignWidth="480"
                            shell:SystemTray.IsVisible="True"
                            DataContext="{Binding SearchAreaViewModel, Source={StaticResource Locator}}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="88" />
            <RowDefinition Height="608" />
        </Grid.RowDefinitions>
        <TextBox x:Name="SearchQuery"
                 Text="{Binding SearchQuery, Mode=TwoWay}"
                 Margin="0,0,84,0" />
        <Button Content="go"
                Command="{Binding SelectBingSearchCommand}"
                HorizontalAlignment="Right"
                Margin="0"
                d:LayoutOverrides="Height" />

        <Microsoft_Phone_Controls_Maps:Map x:Name="searchresultsnearbymap"
                                           ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}"
                                           Center="{Binding CurrentMapSearchCenterPoint, Mode=TwoWay}"
                                           ZoomBarVisibility="Collapsed"
                                           CopyrightVisibility="Visible"
                                           AnimationLevel="UserInput"
                                           HorizontalContentAlignment="Stretch"
                                           VerticalContentAlignment="Stretch"
                                           Grid.RowSpan="2"
                                           Background="{StaticResource SemiOpaqueDarkBackBrush}"
                                           d:LayoutOverrides="GridBox"
                                           Grid.Row="1">

            <Microsoft_Phone_Controls_Maps:MapItemsControl x:Name="ResultsList"
                                                           ItemTemplate="{StaticResource MapPinPhoneBookDataTemplate}"
                                                           ItemsSource="{Binding SearchResult.Results}" />
        </Microsoft_Phone_Controls_Maps:Map>
    </Grid>

    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True"
                              IsMenuEnabled="True">
            <shell:ApplicationBarIconButton  IconUri="/Icons/App_MyLocation.png"
                                             Text="find" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <i:Interaction.Behaviors>

        <Behaviors:ApplicationBarIconButtonCommand TextKey="find"
                                                   CommandBinding="{Binding ExecuteSelectFindMyCurrentLocationCommand}" />
    </i:Interaction.Behaviors>-->
</phone:PhoneApplicationPage>
